package homework;

public class HomeWork17 {
    public ListNode middleNode(ListNode head) {
        ListNode cur=head;
        int count=0;
        while (cur!=null){
            cur=cur.next;
            count++;
        }
        count/=2;
        while (count!=0){
            head=head.next;
            count--;
        }
        return head;
    }
}
